package com.esms.utils;

public class  Text2Html {
    public static String TextToHtml(String str) {
        if (str == null) {
            return "";
        }else if (str.length() == 0) {
            return "";
        }
        str = str.replaceAll("\n", "<br />");
        str = str.replaceAll("\r\n", "<br />");//windows下是\n，linux下是\r\n
        return str;
    }
    /**
    public static String Text2Html(String str) {
        if (str == null) {
            return "";
        }else if (str.length() == 0) {
            return "";
        }
        str = str.replaceAll("\n", "<br />");
        str = str.replaceAll("\r\n", "<br />");//windows下是\n，linux下是\r\n
        return str;
    }
    **/
}
